package main;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import job.CallBackImpl;
import job.CallBackItf;
import factory.FactoryItf;

public class Client {
	public static void main(String args[]) {
		try {
			Registry registry = LocateRegistry.getRegistry();
			FactoryItf factory  = (FactoryItf) registry.lookup("LaFactory");		
			CallBackItf cb = (CallBackItf) UnicastRemoteObject.exportObject(new CallBackImpl(),0);	
			factory.creerJob(1,cb).faireJob();
			factory.creerJob(2,cb).faireJob();
			factory.creerJob(3,cb).faireJob();
			
		} catch (Exception e) {
			System.out.println("Client exception: " +e);
		}
	}
}
